<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>抽奖记录</title>
		<link rel="stylesheet" type="text/css" href="css/iview.css" />
		<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/iview.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="vue">
			<div class="title">抽奖记录</div>
			<i-table :columns="prize_columns" align="center" :data="prize_data">
			</i-table>
		</div>
		<script src="js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/config.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/main.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			new Vue({
				el: '#vue',
				data: {
					prize_columns: [{
							title: '姓名',
							key: 'name',
							align:"center"
						},
						{
							title: '等级',
							key: 'prizeGrade',
							align:"center"
						},
						{
							title: '奖项',
							key: 'prizeDetail',
							align:"center"
						},
						{
							title: '中奖时间',
							key: 'recordDate',
							width:'100',
							align:"center"
						}
					],
					prize_data: []
				},
				mounted() {
					Api.prize_record({
						empId:Tools.GetRequest()["empId"],
						date:Tools.dateFormat("YYYY-mm-dd", new Date())
					}).then(res=>{
						// console.log(res);
						if(res.code==200){
							let data=res.result;
							//数据处理和过滤
							for(let item in data){
								// console.log(data[item]);
								if(data[item].prizeGrade!="谢谢惠顾"){
									// console.log(res.result.prizeGrade);
									data[item].prizeDetail=data[item].prizeDetail+'元小礼品'
									let arr=data[item].name.split('');
									for(let item in arr){
										if(item==1){
											arr[item]='*';
										}
									}
									data[item].name=arr.join('');
									this.prize_data.push(data[item])
								}
							}
						}
					})
				},
				methods:{
					
				}
			})
		</script>
	</body>
</html>
